import { DragDropModule } from '@angular/cdk/drag-drop';
import { ScrollingModule } from '@angular/cdk/scrolling';
import { NgModule } from '@angular/core';
import { apiConf } from '@conf/api.conf';
import { NgxTinymceModule } from 'ngx-tinymce';
import { environment } from '@env/environment';


const TinyMce = NgxTinymceModule.forRoot({
  baseURL: 'assets/tinymce/',
  config: {
    language_url: 'assets/tinymce/langs/zh_CN.js',
    language: 'zh_CN',
    placeholder: '请输入内容',
    plugins: [
      'advlist autolink link image lists charmap print preview hr anchor pagebreak',
      'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
      'table emoticons template paste help'
    ],
    toolbar:
      'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | ' +
      'bullist numlist outdent indent | link image | print preview media fullscreen | ' +
      'forecolor backcolor emoticons | help',
    menu: {
      favs: { title: '常用', items: 'code visualaid | searchreplace | emoticons' }
    },
    menubar: 'favs file edit view insert format tools table help',
    content_css: 'css/content.css',
    content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
    automatic_uploads: false,
    images_upload_url: apiConf.fileUpload,
    paste_block_drop: false,
    paste_data_images: true,
    image_advtab: true,
    color_cols: 4,
    font_formats:
      '宋体=simsun,serif;' +
      '仿宋=FangSong,serif;' +
      '新宋体=NSimSun,serif;' +
      '黑体=SimHei,serif;' +
      '楷体=KaiTi,serif;' +
      '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;' +
      '隶书=LiSu,serif;' +
      '幼圆=YouYuan,serif;' +
      '华文细黑=STXihei,serif;' +
      '华文楷体=STKaiti,serif;' +
      '华文宋体=STSong,serif;' +
      // 默认字体
      'Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats',
    fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt'
  }
});

const SHARED_THIRD_MODULES = [DragDropModule, ScrollingModule];

@NgModule({
  declarations: [],
  entryComponents: [],
  imports: [...SHARED_THIRD_MODULES, TinyMce],
  exports: [...SHARED_THIRD_MODULES, NgxTinymceModule]
})
export class SharedThirdModule {}
